package com.app.micaihu.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.app.micaihu.R;
import com.app.micaihu.base.AppBaseAdapter;

import java.util.List;

/**
 * 搜索热词适配器
 */
public class SearchGridAdapter extends AppBaseAdapter<String> {

	public SearchGridAdapter(List<String> list, Context context) {
		super(list, context);
	}

	@Override
	public View creatView(int position, View convertView, ViewGroup parent) {
		ViewHolder viewHolder=null;
		if(convertView==null){
			convertView=inflater.inflate(R.layout.item_search_grid, null);
			viewHolder=new ViewHolder(convertView);
			convertView.setTag(viewHolder);
		}else{
			viewHolder=(ViewHolder) convertView.getTag();
		}
		viewHolder.textView_hot.setText(list.get(position));
		return convertView;
	}
	class ViewHolder{
		TextView textView_hot;
		public ViewHolder(View view){
			textView_hot=(TextView) view.findViewById(R.id.textView_hot);
		}
	}
}
